{include file='header.tpl'}
{include file='admin/leftcol.tpl'}
<div id="left-area">
<div class="entry post clearfix width-for-all-img">
          <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
           <span class="raquo"> &raquo; </span><a href="{geturl controller="admin" action="index"}">Админ панель</a>  
           <span class="raquo"> &raquo; </span><a href="{geturl controller='admin' action='categories'}">Категории</a>  
             {if $kroshki} {foreach from=$kroshki item="cat"}   <span class="raquo"> &raquo; </span><a href="{geturl route="admincatsub" cat=$cat->getId()}">{$cat->name}</a>   
                {/foreach}{/if}
    </div>
    <h1 class="category-title">Категории</h1>
      <a href="{geturl route='addcategory'}" class="button pink" >Добавить категорию</a>
  
    <div class="botline"></div>
    <table class="tdzayavki" width="100%">
        <thead>
            <tr> 
                <td>
                    {if $sort=='name'}
                    <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Имя</a>
                    {else}
                    <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}">Имя</a>
                    {/if}
                </td>
                <td>
                    {if $sort=='alias'}
                    <a href="?sort=alias&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">ЧПУ</a>
                    {else}
                    <a href="?sort=alias&order={if $order=='desc'}asc{else}desc{/if}">ЧПУ</a>
                    {/if}
                </td>
               <td class="tb5">Подкатегории</td>
                <td class="tb5">Действие</td>
            </tr>
        </thead>
        {foreach from=$categories item=d}
                <tr id="tr_{$d->getId()}">
                    <td class="" id="name_{$d->getId()}">
                        <a href="/category/{$d->getId()}" id="name_{$d->getId()}"><b>{$d->name}</b></a>
                    </td>
                    <td>
                        {$d->alias}
                    </td>
                    <td>
                        {if $d->child|@count > 0}
                            <a href="{geturl route="admincatsub" cat=$d->getId()}">просмотр</a>
                        {/if}
                    </td>
                    <td> 
                           <a href="{geturl route='editcategory' id=$d->getId()}"><img src="/images/index-14.png" alt="Редактировать"></a>
                           <a onclick="deletecategory({$d->getId()})" style="cursor: pointer"><img src="/images/index-07.png" alt="Удалить"></a>
                    </td>
                </tr>
                {if $d->child|@count > 0}
                    
                {/if}
            {foreachelse}
                <tr><td colspan="2">Нет категорий</td></tr>
            {/foreach}
      
    </table>
      <a href="{geturl route='addcategory'}" class="button pink" >Добавить категорию</a>
      
 

</div>
</div>
{include file="footer.tpl"}

